<?php

//error_reporting(E_ERROR | E_WARNING | E_PARSE);
mysql_connect(localhost, root, root);
@mysql_select_db(hero) or die("Unable to select database");
set_time_limit(0);
ini_set("memory_limit", "200M");
//$dateTime = date("Y-m-d",strtotime("-1 day"));
//$handle = fopen("http://192.168.0.185/log/test/$dateTime.'a'", "r");
$handle = fopen("/var/www/log/auditNew/log", "r");
while (!feof($handle)) {
    $buffer = fgets($handle, 10960);
    // $array[] = $buffer;
    $arr = json_decode($buffer, true);
    $id100 = $arr["data"];
    $arr2 = json_decode($id100, true);
    $id101 = $arr2["battleInfos"];

    $arr5 = json_decode($id100, true);
    $id_add = $arr5["arenaInfos"];
    
    //$arr3 = json_decode($id101, true); 
       
    $id102 = $id101["ruleInfos_107"];  //ruleInfos_107
   // $arr3 = json_decode($id102, true); 
     $id103 = $id102["battleGroundLevelInfos_3"];  //battleGroundLevelInfos_3
     $id104 = $id103["faildTimes"];
     $id105 = $id103["level"];
     $id106 = $id103["retreatTimes"]; 
     $id107 = $id103["totalTimes"]; 
     $id108 = $id103["winTimes"];

     $id109 = $id102["battleGroundLevelInfos_1"];  //battleGroundLevelInfos_1
     $id110 = $id103["faildTimes"];
     $id111 = $id103["level"];
     $id112 = $id103["retreatTimes"]; 
     $id113 = $id103["totalTimes"]; 
     $id114 = $id103["winTimes"];

     $id115 = $id102["battleGroundLevelInfos_2"];  //battleGroundLevelInfos_1
     $id116 = $id103["faildTimes"];
     $id117 = $id103["level"];
     $id118 = $id103["retreatTimes"]; 
     $id119 = $id103["totalTimes"]; 
     $id120 = $id103["winTimes"];


    $id121 = $id101["ruleInfos_64"];  //ruleInfos_64
   // $arr3 = json_decode($id102, true); 
     $id122 = $id121["battleGroundLevelInfos_2"];  //battleGroundLevelInfos_2
     $id123 = $id121["faildTimes"];
     $id124 = $id121["level"];
     $id125 = $id121["retreatTimes"]; 
     $id126 = $id121["totalTimes"]; 
     $id127 = $id121["winTimes"];

     $id128 = $id121["battleGroundLevelInfos_5"];  //battleGroundLevelInfos_5
     $id129 = $id121["faildTimes"];
     $id130 = $id121["level"];
     $id131 = $id121["retreatTimes"]; 
     $id132 = $id121["totalTimes"]; 
     $id133 = $id121["winTimes"];

     /*$id134 = $id121["battleGroundLevelInfos_2"];  //battleGroundLevelInfos_1
     $id135 = $id121["faildTimes"];
     $id136 = $id121["level"];
     $id137 = $id121["retreatTimes"]; 
     $id138 = $id121["totalTimes"]; 
     $id139 = $id121["winTimes"];*/

    $id134 = $id101["ruleInfos_81"];  //ruleInfos_81
   // $arr3 = json_decode($id102, true); 
     $id135 = $id134["battleGroundLevelInfos_3"];  //battleGroundLevelInfos_3
     $id136 = $id134["faildTimes"];
     $id137 = $id134["level"];
     $id138 = $id134["retreatTimes"]; 
     $id139 = $id134["totalTimes"]; 
     $id140 = $id134["winTimes"];

     $id141 = $id134["battleGroundLevelInfos_1"];  //battleGroundLevelInfos_1
     $id142 = $id134["faildTimes"];
     $id143 = $id134["level"];
     $id144 = $id134["retreatTimes"]; 
     $id145 = $id134["totalTimes"]; 
     $id146 = $id134["winTimes"];

     $id147 = $id134["battleGroundLevelInfos_2"];  //battleGroundLevelInfos_2
     $id148 = $id134["faildTimes"];
     $id149 = $id134["level"];
     $id150 = $id134["retreatTimes"]; 
     $id151 = $id134["totalTimes"]; 
     $id152 = $id134["winTimes"];
     
      $id153 = $id101["ruleInfos_83"];  //ruleInfos_83
   // $arr3 = json_decode($id102, true); 
     $id154 = $id153["battleGroundLevelInfos_4"];  //battleGroundLevelInfos_4
     $id155 = $id153["faildTimes"];
     $id156 = $id153["level"];
     $id157 = $id153["retreatTimes"]; 
     $id158 = $id153["totalTimes"]; 
     $id159 = $id153["winTimes"];

     $id160 = $id101["ruleInfos_89"];  //ruleInfos_89
     $id161 = $id160["battleGroundLevelInfos_2"];  //battleGroundLevelInfos_2
     $id162 = $id160["faildTimes"];
     $id163 = $id160["level"];
     $id164 = $id160["retreatTimes"]; 
     $id165 = $id160["totalTimes"]; 
     $id166 = $id160["winTimes"];

     $id167 = $id101["ruleInfos_91"];  //ruleInfos_91
     $id168 = $id167["battleGroundLevelInfos_1"];  //battleGroundLevelInfos_1
     $id169 = $id167["faildTimes"];
     $id170 = $id167["level"];
     $id171 = $id167["retreatTimes"]; 
     $id172 = $id167["totalTimes"]; 
     $id173 = $id167["winTimes"];

     $id167a = $id101["ruleInfos_93"];  //ruleInfos_93
     $id168a= $id167a["battleGroundLevelInfos_1"];  //battleGroundLevelInfos_1
     $id169a = $id167a["faildTimes"];
     $id170a = $id167a["level"];
     $id171a = $id167a["retreatTimes"]; 
     $id172a = $id167a["totalTimes"]; 
     $id173a = $id167a["winTimes"];
     
     $id174 = $id101["ruleInfos_94"];  //ruleInfos_94
     $id175 = $id174["battleGroundLevelInfos_1"];  //battleGroundLevelInfos_1
     $id176 = $id174["faildTimes"];
     $id177 = $id174["level"];
     $id178 = $id174["retreatTimes"]; 
     $id179 = $id174["totalTimes"]; 
     $id180 = $id174["winTimes"];

    $id181 = $arr2["buyEquipInfos"];  //buyEquipInfos
     $id182 = $id181["buyEquipCost"];  //buyEquipCost
     $id183 = $id181["buyEquipTimes"];  //buyEquipTimes
     $id184 = $arr2["currentMoney"]; 
    $id185 = $arr2["date"];  
    $id186= $arr2["equipInfos"];    //equipInfos
    $id187= $id186["equipData_16"];   //equipData_16
    $id188= $id187["equipIndex"];
    $id189= $id187["level"];  
    $id190= $id186["equipData_212"];   //equipData_212
    $id191= $id190["equipIndex"];
    $id192= $id190["level"];  
    $id193= $id186["equipData_32"];   //equipData_32
    $id194= $id193["equipIndex"];
    $id195= $id193["level"];  
    $id196= $id186["equipData_404"];   //equipData_404
    $id197= $id196["equipIndex"];
    $id198= $id196["level"];
    $id199= $id186["equipData_54"];   //equipData_54
    $id200= $id199["equipIndex"];
    $id201= $id199["level"];  
    $id202= $id186["equipData_63"];   //equipData_63
    $id203= $id202["equipIndex"];
    $id204= $id202["level"];  

    $id205 = $arr2["exitWhichBattleGround"];  //exitWhichBattleGround
    $id206 = $arr2["exitWhichScreen"];  //exitWhichScreen
    $id207 = $arr2["heroInfos"];  //heroInfos

    $id208 = $id207["heroData_0"]; //heroData_0
    $id209 = $id208["currentEquips"]; //currentEquips
    $id210 = $id208["heroID"]; //heroID
    $id211 = $id208["level"]; //level
    $id212 = $id208["todayGetExp"]; //todayGetExp
    $id213 = $id208["heroID"]; //heroID

    $id214 = $id207["heroData_1"]; //heroData_1
    $id215 = $id214["currentEquips"]; //currentEquips
    $id216 = $id214["heroID"]; //heroID
    $id217 = $id214["level"]; //level
    $id218 = $id214["todayGetExp"]; //todayGetExp
    $id219 = $id214["heroID"]; //heroID

    $id220 = $id207["heroData_2"]; //heroData_1
    $id221 = $id220["currentEquips"]; //currentEquips
    $id222 = $id220["heroID"]; //heroID
    $id223 = $id220["level"]; //level
    $id224 = $id220["todayGetExp"]; //todayGetExp
    $id225 = $id220["heroID"]; //heroID

    $id226 = $id207["heroData_3"]; //heroData_1
    $id227 = $id226["currentEquips"]; //currentEquips
    $id228 = $id226["heroID"]; //heroID
    $id229 = $id226["level"]; //level
    $id230 = $id226["todayGetExp"]; //todayGetExp
    $id231 = $id226["heroID"]; //heroID
        $id4226 = $id207["heroData_4"]; //heroData_4
    $id4227 = $id4226["currentEquips"]; //currentEquips
    $id4228 = $id4226["heroID"]; //heroID
    $id4229 = $id4226["level"]; //level
    $id4230 = $id4226["todayGetExp"]; //todayGetExp
    $id4231 = $id4226["heroID"]; //heroID
        $id5226 = $id207["heroData_5"]; //heroData_5
    $id5227 = $id5226["currentEquips"]; //currentEquips
    $id5228 = $id5226["heroID"]; //heroID
    $id5229 = $id5226["level"]; //level
    $id5230 = $id5226["todayGetExp"]; //todayGetExp
    $id5231 = $id5226["heroID"]; //heroID
        $id6226 = $id207["heroData_6"]; //heroData_6
    $id6227 = $id6226["currentEquips"]; //currentEquips
    $id6228 = $id6226["heroID"]; //heroID
    $id6229 = $id6226["level"]; //level
    $id6230 = $id6226["todayGetExp"]; //todayGetExp
    $id6231 = $id6226["heroID"]; //heroID
        $id7226 = $id207["heroData_7"]; //heroData_7
    $id7227 = $id7226["currentEquips"]; //currentEquips
    $id7228 = $id7226["heroID"]; //heroID
    $id7229 = $id7226["level"]; //level
    $id7230 = $id7226["todayGetExp"]; //todayGetExp
    $id7231 = $id7226["heroID"]; //heroID
        $id8226 = $id207["heroData_8"]; //heroData_8
    $id8227 = $id8226["currentEquips"]; //currentEquips
    $id8228 = $id8226["heroID"]; //heroID
    $id8229 = $id8226["level"]; //level
    $id8230 = $id8226["todayGetExp"]; //todayGetExp
    $id8231 = $id8226["heroID"]; //heroID
        $id9226 = $id207["heroData_9"]; //heroData_9
    $id9227 = $id9226["currentEquips"]; //currentEquips
    $id9228 = $id9226["heroID"]; //heroID
    $id9229 = $id9226["level"]; //level
    $id9230 = $id9226["todayGetExp"]; //todayGetExp
    $id9231 = $id9226["heroID"]; //heroID
        $id10226 = $id207["heroData_10"]; //heroData_10
    $id10227 = $id10226["currentEquips"]; //currentEquips
    $id10228 = $id10226["heroID"]; //heroID
    $id10229 = $id10226["level"]; //level
    $id10230 = $id10226["todayGetExp"]; //todayGetExp
    $id10231 = $id10226["heroID"]; //heroID
        $id11226 = $id207["heroData_11"]; //heroData_11
    $id11227 = $id11226["currentEquips"]; //currentEquips
    $id11228 = $id11226["heroID"]; //heroID
    $id11229 = $id11226["level"]; //level
    $id11230 = $id11226["todayGetExp"]; //todayGetExp
    $id11231 = $id11226["heroID"]; //heroID
        $id12226 = $id207["heroData_12"]; //heroData_12
    $id12227 = $id12226["currentEquips"]; //currentEquips
    $id12228 = $id12226["heroID"]; //heroID
    $id12229 = $id12226["level"]; //level
    $id12230 = $id12226["todayGetExp"]; //todayGetExp
    $id12231 = $id12226["heroID"]; //heroID
        $id13226 = $id207["heroData_13"]; //heroData_13
    $id13227 = $id13226["currentEquips"]; //currentEquips
    $id13228 = $id13226["heroID"]; //heroID
    $id13229 = $id13226["level"]; //level
    $id13230 = $id13226["todayGetExp"]; //todayGetExp
    $id13231 = $id13226["heroID"]; //heroID
        $id14226 = $id14207["heroData_14"]; //heroData_1
    $id14227 = $id14226["currentEquips"]; //currentEquips
    $id14228 = $id14226["heroID"]; //heroID
    $id14229 = $id14226["level"]; //level
    $id14230 = $id14226["todayGetExp"]; //todayGetExp
    $id14231 = $id14226["heroID"]; //heroID
        $id15226 = $id207["heroData_15"]; //heroData_1
    $id15227 = $id15226["currentEquips"]; //currentEquips
    $id15228 = $id15226["heroID"]; //heroID
    $id15229 = $id15226["level"]; //level
    $id15230 = $id15226["todayGetExp"]; //todayGetExp
    $id15231 = $id15226["heroID"]; //heroID
        $id16226 = $id207["heroData_16"]; //heroData_1
    $id16227 = $id16226["currentEquips"]; //currentEquips
    $id16228 = $id16226["heroID"]; //heroID
    $id16229 = $id16226["level"]; //level
    $id16230 = $id16226["todayGetExp"]; //todayGetExp
    $id16231 = $id16226["heroID"]; //heroID
        $id17226 = $id207["heroData_17"]; //heroData_1
    $id17227 = $id17226["currentEquips"]; //currentEquips
    $id17228 = $id17226["heroID"]; //heroID
    $id17229 = $id17226["level"]; //level
    $id17230 = $id17226["todayGetExp"]; //todayGetExp
    $id17231 = $id17226["heroID"]; //heroID
        $id18226 = $id207["heroData_18"]; //heroData_1
    $id18227 = $id18226["currentEquips"]; //currentEquips
    $id18228 = $id18226["heroID"]; //heroID
    $id18229 = $id18226["level"]; //level
    $id18230 = $id18226["todayGetExp"]; //todayGetExp
    $id18231 = $id18226["heroID"]; //heroID
        $id19226 = $id207["heroData_19"]; //heroData_1
    $id19227 = $id19226["currentEquips"]; //currentEquips
    $id19228 = $id19226["heroID"]; //heroID
    $id19229 = $id19226["level"]; //level
    $id19230 = $id19226["todayGetExp"]; //todayGetExp
    $id19231 = $id19226["heroID"]; //heroID
        $id20226 = $id207["heroData_20"]; //heroData_1
    $id20227 = $id20226["currentEquips"]; //currentEquips
    $id20228 = $id20226["heroID"]; //heroID
    $id20229 = $id20226["level"]; //level
    $id20230 = $id20226["todayGetExp"]; //todayGetExp
    $id20231 = $id20226["heroID"]; //heroID
        $id21226 = $id207["heroData_21"]; //heroData_1
    $id21227 = $id21226["currentEquips"]; //currentEquips
    $id21228 = $id21226["heroID"]; //heroID
    $id21229 = $id21226["level"]; //level
    $id21230 = $id21226["todayGetExp"]; //todayGetExp
    $id21231 = $id21226["heroID"]; //heroID
        $id22226 = $id207["heroData_22"]; //heroData_1
    $id22227 = $id22226["currentEquips"]; //currentEquips
    $id22228 = $id22226["heroID"]; //heroID
    $id22229 = $id22226["level"]; //level
    $id22230 = $id22226["todayGetExp"]; //todayGetExp
    $id22231 = $id22226["heroID"]; //heroID
        $id23226 = $id207["heroData_23"]; //heroData_1
    $id23227 = $id23226["currentEquips"]; //currentEquips
    $id23228 = $id23226["heroID"]; //heroID
    $id23229 = $id23226["level"]; //level
    $id23230 = $id23226["todayGetExp"]; //todayGetExp
    $id23231 = $id23226["heroID"]; //heroID
        $id24226 = $id207["heroData_24"]; //heroData_1
    $id24227 = $id24226["currentEquips"]; //currentEquips
    $id24228 = $id24226["heroID"]; //heroID
    $id24229 = $id24226["level"]; //level
    $id24230 = $id24226["todayGetExp"]; //todayGetExp
    $id24231 = $id24226["heroID"]; //heroID
        $id25226 = $id207["heroData_25"]; //heroData_1
    $id25227 = $id25226["currentEquips"]; //currentEquips
    $id25228 = $id25226["heroID"]; //heroID
    $id25229 = $id25226["level"]; //level
    $id25230 = $id25226["todayGetExp"]; //todayGetExp
    $id25231 = $id25226["heroID"]; //heroID
        $id26226 = $id207["heroData_26"]; //heroData_1
    $id26227 = $id26226["currentEquips"]; //currentEquips
    $id26228 = $id26226["heroID"]; //heroID
    $id26229 = $id26226["level"]; //level
    $id26230 = $id26226["todayGetExp"]; //todayGetExp
    $id26231 = $id26226["heroID"]; //heroID
        $id27226 = $id207["heroData_27"]; //heroData_1
    $id27227 = $id27226["currentEquips"]; //currentEquips
    $id27228 = $id27226["heroID"]; //heroID
    $id27229 = $id27226["level"]; //level
    $id27230 = $id27226["todayGetExp"]; //todayGetExp
    $id27231 = $id27226["heroID"]; //heroID
        $id28226 = $id207["heroData_28"]; //heroData_1
    $id28227 = $id28226["currentEquips"]; //currentEquips
    $id28228 = $id28226["heroID"]; //heroID
    $id28229 = $id28226["level"]; //level
    $id28230 = $id28226["todayGetExp"]; //todayGetExp
    $id28231 = $id28226["heroID"]; //heroID
        $id29226 = $id207["heroData_29"]; //heroData_1
    $id29227 = $id29226["currentEquips"]; //currentEquips
    $id29228 = $id29226["heroID"]; //heroID
    $id29229 = $id29226["level"]; //level
    $id29230 = $id29226["todayGetExp"]; //todayGetExp
    $id29231 = $id29226["heroID"]; //heroID
        $id30226 = $id207["heroData_30"]; //heroData_1
    $id30227 = $id30226["currentEquips"]; //currentEquips
    $id30228 = $id30226["heroID"]; //heroID
    $id30229 = $id30226["level"]; //level
    $id30230 = $id30226["todayGetExp"]; //todayGetExp
    $id30231 = $id30226["heroID"]; //heroID
        $id31226 = $id207["heroData_31"]; //heroData_1
    $id31227 = $id31226["currentEquips"]; //currentEquips
    $id31228 = $id31226["heroID"]; //heroID
    $id31229 = $id31226["level"]; //level
    $id31230 = $id31226["todayGetExp"]; //todayGetExp
    $id31231 = $id31226["heroID"]; //heroID
        $id32226 = $id207["heroData_32"]; //heroData_1
    $id32227 = $id32226["currentEquips"]; //currentEquips
    $id32228 = $id32226["heroID"]; //heroID
    $id32229 = $id32226["level"]; //level
    $id32230 = $id32226["todayGetExp"]; //todayGetExp
    $id32231 = $id32226["heroID"]; //heroID

    $id232 = $arr2["hireHeroInfos"];  //hireHeroInfos
     $id233 = $id232["hireHeroCost"];  //hireHeroCost
     $id234 = $id232["hireHeroTimes"];  //hireHeroTimes
     $id235 = $arr2["launchFromNotification"];  //launchFromNotification
     $id236 = $arr2["missEnemyTimes"];  //missEnemyTimes
     $id237 = $arr2["openTimes"];  //openTimes
     $id238 = $arr2["missEnemyTimes"];  //missEnemyTimes
     $id239 = $arr2["registerDate"];  //registerDate
     
     $id240 = $arr2["resetSkillInfos"];  //resetSkillInfos
     $id241 = $id240["resetSkillCost"];  //resetSkillCost //
     $id242 = $id240["resetSkillTimes"];  //resetSkillTimes
     //retreatTimes
    $id243 = $arr2["retreatTimes"];  //retreatTimes
    $id244 = $arr2["roleClassInfos"];  //retreatTimes

    $id245 = $id244["roleClassData_Barbarian"];  //roleClassData_Barbarian
    $id246 = $id245["battleTimes"];  //battleTimes
    $id247 = $id245["count"];  //count
    $id248 = $id245["roleClass"];  //count

    $id249 = $id244["roleClassData_Fighter"];  //roleClassData_Fighter
    $id250 = $id249["battleTimes"];  //battleTimes
    $id251 = $id249["count"];  //count
    $id252 =  $id249["roleClass"];  //roleClass

    $id253  = $id244["roleClassData_Fire Mage"];  //roleClassData_Fire Mage  wait
        //roleClassData_Fire Mage
     
      //roleClassData_Fighter
    $id254  = $id244["roleClassData_Paladin"];  //roleClassData_Paladin
    $id255 = $id254["battleTimes"];  //battleTimes
    $id256 = $id255["count"];  //count
    $id257 =  $id256["roleClass"];  //roleClass

    //shopRefreshInfos
      $id258  = $arr2["shopRefreshInfos"];  //shopRefreshInfos
   $id259 = $id258["shopRefreshCost"];  //shopRefreshCost
   $id260a = $id258["shopRefreshTimes"];  //shopRefreshTimes
   // $id257 =  $id256["roleClass"];  //roleClass

   //survivalBattleInfos
   $id260  = $arr2["survivalBattleInfos"];  //survivalBattleInfos
   $id261 = $id260["survivalBattleTimes"];  //survivalBattleTimes
   $id262 = $id260["wavesEachTime"];  //wavesEachTime

   $id263 = $arr2["teamMemberClass"];  //teamMemberClass
   $id264 = $arr2["todayBuyEquips"];  //teamMemberClass
   $id265 = $arr2["todayGameTime"];  //todayGameTime
    $id266 = $arr2["todayGetMoney"];  //todayGetMoney
   $id267 = $arr2["todayOpenTimes"];  //todayOpenTimes
   $id268 = $arr2["todaySaleEquips"];  //todaySaleEquips
   $id269 = $arr2["todayUseMoney"];  //todayUseMoney
   $id270 = $arr2["topEquipNumber"];  //todayUseMoney
   $id271 = $arr2["upgradeInfos"];  //upgradeInfos
   

   //$arr272a = json_decode($arr, true);
   $id272a = $arr2["upgradeInfos"];
   $id272 = $id272a["upgradeCost"];  //upgradeCost
   $id273 = $id272a["upgradeTimes"];  //upgradeTimes
   $id274 = $arr2["versionNum"];  //versionNum
   $id275 = $arr["gamename"];  //gamename
   $id276 = $arr["uuid"];  //deviceid

   $id277 = $arr["createdate"];  //createdate


    $id = $arr2["Cents099"];
    $id2 = $arr2["Cents1999"];
    $id3 = $arr2["Cents499"];
    $id4 = $arr2["Cents4999"];
    $id5 = $arr2["Cents9999"];
    $id6 = $arr2["Crystal"];
    $id7 = $arr2["IAPMoney"];
    $id8 = $arr2["allGameTime"];
    $id9 = $arr2["allGetMoney"];
   
    $id10 = $arr2["ruleInfos_107"];
     
    $id11 = $id103["faildTimes"];  
    $id12 = $arr2["firstlogindata"];
    $id13 = $arr2["equipInfos_level"];
    $id14 = $arr2["equipInfos"];
    $id15 = $arr2["roleClassInfos_battleTimes"]; 
    $id16 = $arr2["roleClassInfos_count"];
    $id17 = $arr2["roleClassInfos_roleClass"];
    $id18 = $arr2["heroInfos_currentEquips"];
    $id19 = $arr2["heroInfos_level"]; 
    $id20 = $arr2["heroInfos_todayGetExp"];

    $id21 = $arr2["heroInfos"];  
    $id22 = $arr2["battleInfos_retreatTimes"];
    $id23 = $arr2["battleInfos_faildTimes"];
    $id24 = $arr2["battleInfos_winTimes"];
    $id25 = $arr2["battleInfos_totalTimes"]; 
    $id26 = $arr2["battleInfos_level"];
    $id27 = $arr2["battleInfos"];
    $id30 = $arr2["hireHeroCost"];

    $id31 = $arr2["hireHeroTimes"]; 
    $id34 = $arr2["shopRefreshCost"];
    $id35 = $arr2["shopRefreshTimes"]; 
    $id38 = $arr2["resetSkillCost"];
    $id39 = $arr2["resetSkillTimes"]; 
    $id40 = $arr2["todaySaleEquips"];

    $id41 = $arr2["todayBuyEquips"];  
    $id42 = $arr2["teamMemberClass"];
    $id43 = $arr2["launchFromNotification"];
   // $id44 = $arr2["exitWhichBattleGround"];

    $id46 = $arr2["todayOpenTimes"];
    $id47 = $arr2["openTimes"];
    $id48 = $arr2["todayGameTime"];
    $id49 = $arr2["registerDate"]; 
    $id50 = $arr2["versionNum"];
    
   // $id51 = $arr2["uuid"];
   // var_dump($id51);die;
    $id52 = $arr["gamename"];
    $id53 = $arr["whatday"];
    $id54 = $arr["createdate"];
     // $id55 = $arr["date"];

    $id_add1 = $id_add["arenaTodayGameTime"];
    $id_add2 = $id_add["arenaTodayGetBadges"];
    $id_add3 = $id_add["arenaTodayLobbyChallengeTimes"];
    $id_add4 = $id_add["arenaTodayLobbyChallengeWinTimes"];
    $id_add5 = $id_add["arenaTodayOpenTimes"];
    $id_add6 = $id_add["arenaTodayReportChallengeTimes"];
    $id_add7 = $id_add["arenaTodayReportChallengeWinTimes"];
    $id_add8 = $id_add["arenaTodayScoutTimes"];
    $id_add9 = $id_add["arenaTotalGameTime"];
    $id_add10 = $id_add["arenaTotalGetBadges"];
    $id_add11 = $id_add["arenaTotalOpenTimes"];
    

    $s = 0;
    foreach ((array) $arr as $item => $value) {   //Warning: Invalid argument supplied for foreach
        $s = count($value); //
    }
    for ($i = 0; $i < $s; $i++) {
    
    $heroInfos = $id207;

    $heroData_0 = $id213;
    $heroData_0_currentEquips = $id209;
    $heroData_0_level = $id211;
    $heroData_0_todayGetExp = $id212;

    $heroData_1 = $id219;
    $heroData_1_currentEquips = $id215;
    $heroData_1_level = $id217;
    $heroData_1_todayGetExp = $id218;

    $heroData_2 = $id222;
    $heroData_2_currentEquips = $id221;
    $heroData_2_level = $id223;
    $heroData_2_todayGetExp = $id224;

    $heroData_3 = $id228;
    $heroData_3_currentEquips = $id227;
    $heroData_3_level = $id229;
    $heroData_3_todayGetExp = $id230;

    $heroData_4 = $id4228;
    $heroData_4_currentEquips = $id4227;
    $heroData_4_level = $id4229;
    $heroData_4_todayGetExp = $id4230;

    $heroData_5 = $id5228;
    $heroData_5_currentEquips = $id5227;
    $heroData_5_level = $id5229;
    $heroData_5_todayGetExp = $id5230;

    $heroData_6 = $id6228;
    $heroData_6_currentEquips = $id6227;
    $heroData_6_level = $id6229;
    $heroData_6_todayGetExp = $id6230;

    $heroData_7 = $id7228;
    $heroData_7_currentEquips = $id7227;
    $heroData_7_level = $id7229;
    $heroData_7_todayGetExp = $id7230;

    $heroData_8 = $id8228;
    $heroData_8_currentEquips = $id8227;
    $heroData_8_level = $id8229;
    $heroData_8_todayGetExp = $id8230;

    $heroData_9 = $id9228;
    $heroData_9_currentEquips = $id9227;
    $heroData_9_level = $id9229;
    $heroData_9_todayGetExp = $id9230;

    $heroData_10 = $id10228;
    $heroData_10_currentEquips = $id10227;
    $heroData_10_level = $id10229;
    $heroData_10_todayGetExp = $id10230;

    $heroData_11 = $id11228;
    $heroData_11_currentEquips = $id11227;
    $heroData_11_level = $id11229;
    $heroData_11_todayGetExp = $id11230;

    $heroData_12 = $id12228;
    $heroData_12_currentEquips = $id12227;
    $heroData_12_level = $id12229;
    $heroData_12_todayGetExp = $id12230;

    $heroData_13 = $id13228;
    $heroData_13_currentEquips = $id13227;
    $heroData_13_level = $id13229;
    $heroData_13_todayGetExp = $id13230;

    $heroData_14 = $id14228;
    $heroData_14_currentEquips = $id14227;
    $heroData_14_level = $id14229;
    $heroData_14_todayGetExp = $id14230;

    $heroData_15 = $id15228;
    $heroData_15_currentEquips = $id15227;
    $heroData_15_level = $id15229;
    $heroData_15_todayGetExp = $id15230;

    $heroData_16 = $id16228;
    $heroData_16_currentEquips = $id16227;
    $heroData_16_level = $id16229;
    $heroData_16_todayGetExp = $id16230;

    $heroData_17 = $id17228;
    $heroData_17_currentEquips = $id17227;
    $heroData_17_level = $id17229;
    $heroData_17_todayGetExp = $id17230;

    $heroData_18 = $id18228;
    $heroData_18_currentEquips = $id18227;
    $heroData_18_level = $id18229;
    $heroData_18_todayGetExp = $id18230;

    $heroData_19 = $id19228;
    $heroData_19_currentEquips = $id19227;
    $heroData_19_level = $id19229;
    $heroData_19_todayGetExp = $id19230;

    $heroData_20 = $id20228;
    $heroData_20_currentEquips = $id20227;
    $heroData_20_level = $id20229;
    $heroData_20_todayGetExp = $id20230;

    $heroData_21 = $id21228;
    $heroData_21_currentEquips = $id21227;
    $heroData_21_level = $id21229;
    $heroData_21_todayGetExp = $id21230;

    $heroData_22 = $id22228;
    $heroData_22_currentEquips = $id22227;
    $heroData_22_level = $id22229;
    $heroData_22_todayGetExp = $id22230;

    $heroData_23 = $id23228;
    $heroData_23_currentEquips = $id23227;
    $heroData_23_level = $id23229;
    $heroData_23_todayGetExp = $id23230;

    $heroData_24 = $id24228;
    $heroData_24_currentEquips = $id24227;
    $heroData_24_level = $id24229;
    $heroData_24_todayGetExp = $id24230;

    $heroData_25 = $id25228;
    $heroData_25_currentEquips = $id25227;
    $heroData_25_level = $id25229;
    $heroData_25_todayGetExp = $id25230;

    $heroData_26 = $id26228;
    $heroData_26_currentEquips = $id26227;
    $heroData_26_level = $id26229;
    $heroData_26_todayGetExp = $id26230;

    $heroData_27 = $id27228;
    $heroData_27_currentEquips = $id27227;
    $heroData_27_level = $id27229;
    $heroData_27_todayGetExp = $id27230;

    $heroData_28 = $id28228;
    $heroData_28_currentEquips = $id28227;
    $heroData_28_level = $id28229;
    $heroData_28_todayGetExp = $id28230;

    $heroData_29 = $id29228;
    $heroData_29_currentEquips = $id29227;
    $heroData_29_level = $id29229;
    $heroData_29_todayGetExp = $id29230;

    $heroData_30 = $id30228;
    $heroData_30_currentEquips = $id30227;
    $heroData_30_level = $id30229;
    $heroData_30_todayGetExp = $id30230;

    $heroData_31 = $id31228;
    $heroData_31_currentEquips = $id31227;
    $heroData_31_level = $id31229;
    $heroData_31_todayGetExp = $id31230;

    $heroData_32 = $id32228;
    $heroData_32_currentEquips = $id32227;
    $heroData_32_level = $id32229;
    $heroData_32_todayGetExp = $id32230;

    $buyEquipCost = $id182; 
    $buyEquipTimes = $id183; 
    $exitWhichScreen = $id206;
    $exitWhichBattleGround = $id205;
    $hireHeroInfos = $id232;
    $hireHeroCost = $id233;
    $hireHeroTimes = $id234;
    $launchFromNotification = $id235;
    $missEnemyTimes = $id236;
    $openTimes = $id237;
    $missEnemyTimes = $id238;
    $registerDate = $id239;

    $resetSkillInfos = $id240;
    $resetSkillCost = $id241;
    $resetSkillTimes = $id242;

    $retreatTimes = $id243;
    $roleClassInfos = $id244;
    $roleClassData_Barbarian = $id245;
    $roleClassData_Barbarian_battleTimes = $id246;
    $roleClassData_Barbarian_count = $id247;
    $roleClassData_Barbarian_roleClass = $id248;

    $roleClassData_Fighter = $id249;
    $roleClassData_Fighter_battleTimes = $id250;
    $roleClassData_Fighter_count = $id251;
    $roleClassData_Fighter_roleClass = $id252;



    //$id253  = $id244["roleClassData_Fire Mage"];  //roleClassData_Fire Mage  wait

      
    $roleClassData_Paladin = $id254;
    $roleClassData_Paladin_battleTimes = $id255;
    $roleClassData_Paladin_count = $id256;
    $roleClassData_Paladin_roleClass = $id257;

    $shopRefreshInfos = $id258; 
    $shopRefreshCost = $id259; 
    $shopRefreshTimes = $id260a; 
    $survivalBattleInfos = $id260; 
    $survivalBattleTimes = $id261; 
    $wavesEachTime = $id262; 
    $teamMemberClass = $id263; 
    $todayBuyEquips = $id264; 
    $todayGameTime = $id265; 
    $todayGetMoney = $id266; 
    $todayOpenTimes = $id267; 
    $todaySaleEquips = $id268; 
    $todayUseMoney = $id269; 
    $topEquipNumber = $id270; 
    $upgradeInfos = $id271; 
    $upgradeCost = $id272; 
    $upgradeTimes = $id273; 
    $versionNum = $id274; 
    $gamename = $id275; 
    $deviceid = $id276; 
    $createdate = $id277; 
    $Cents099 = $id; 
    //var_dump($Cents099);die;
    $Cents1999 = $id2; 
    $Cents499 = $id3; 
    $Cents4999 = $id4; 
    $Cents9999 = $id5; 
    $Crystal = $id6; 
    $IAPMoney = $id7; 
    $allGameTime = $id8; 
    $allGetMoney = $id9; 

    $arenaTodayGameTime = $id_add1;
    $arenaTodayGetBadges = $id_add2;
    $arenaTodayLobbyChallengeTimes = $id_add3;
    $arenaTodayLobbyChallengeWinTimes = $id_add4;
    $arenaTodayOpenTimes = $id_add5;
    $arenaTodayReportChallengeTimes = $id_add6;
    $arenaTodayReportChallengeWinTimes = $id_add7;
    $arenaTodayScoutTimes = $id_add8;
    $arenaTotalGameTime =  $id_add9;
    $arenaTotalGetBadges = $id_add10;
    $arenaTotalOpenTimes = $id_add11;


        mysql_query("INSERT INTO hero_query (cents099, Cents1999,Cents499,Cents4999,Cents9999,IAPMoney,
                                        allGameTime,allGetMoney,createdate,date,gamename,deviceid,versionNum,
                                        registerDate,todayGameTime,openTimes,todayOpenTimes,exitWhichScreen,exitWhichBattleGround,launchFromNotification,
                                        teamMemberClass,todayBuyEquips,todaySaleEquips,resetSkillTimes,resetSkillCost,buyEquipTimes,
                                        buyEquipCost,shopRefreshTimes,shopRefreshCost,upgradeTimes,upgradeCost,hireHeroTimes,hireHeroCost,
                                        survivalBattleTimes,wavesEachTime,battleInfos,
                                        roleClassData_Barbarian_roleClass,roleClassData_Barbarian_count,roleClassData_Barbarian_battleTimes,roleClassData_Fighter_roleClass,roleClassData_Fighter_count,
   roleClassData_Fighter_battleTimes,roleClassData_Paladin_roleClass,roleClassData_Paladin_count,roleClassData_Paladin_battleTimes,
                                        heroData_0_currentEquips, heroData_0_level, heroData_0_todayGetExp, heroData_0, heroData_1_currentEquips, heroData_1_level, heroData_1_todayGetExp, heroData_1, heroData_2_currentEquips, heroData_2_level, heroData_2_todayGetExp, heroData_2, heroData_3_currentEquips, heroData_3_level, heroData_3_todayGetExp, heroData_3, heroData_4_currentEquips, heroData_4_level, heroData_4_todayGetExp, heroData_4, heroData_5_currentEquips, heroData_5_level, heroData_5_todayGetExp, heroData_5, heroData_6_currentEquips, heroData_6_level, heroData_6_todayGetExp, heroData_6, heroData_7_currentEquips, heroData_7_level, heroData_7_todayGetExp, heroData_7, heroData_8_currentEquips, heroData_8_level, heroData_8_todayGetExp, heroData_8, heroData_9_currentEquips, heroData_9_level, heroData_9_todayGetExp, heroData_9, heroData_10_currentEquips, heroData_10_level, heroData_10_todayGetExp, heroData_10, heroData_11_currentEquips, heroData_11_level, heroData_11_todayGetExp, heroData_11, heroData_12_currentEquips, heroData_12_level, heroData_12_todayGetExp, heroData_12, heroData_13_currentEquips, heroData_13_level, heroData_13_todayGetExp, heroData_13, heroData_14_currentEquips, heroData_14_level, heroData_14_todayGetExp, heroData_14, heroData_15_currentEquips, heroData_15_level, heroData_15_todayGetExp, heroData_15, heroData_16_currentEquips, heroData_16_level, heroData_16_todayGetExp, heroData_16, heroData_17_currentEquips, heroData_17_level, heroData_17_todayGetExp, heroData_17, heroData_18_currentEquips, heroData_18_level, heroData_18_todayGetExp, heroData_18, heroData_19_currentEquips, heroData_19_level, heroData_19_todayGetExp, heroData_19, heroData_20_currentEquips, heroData_20_level, heroData_20_todayGetExp, heroData_20, heroData_21_currentEquips, heroData_21_level, heroData_21_todayGetExp, heroData_21, heroData_22_currentEquips, heroData_22_level, heroData_22_todayGetExp, heroData_22, heroData_23_currentEquips, heroData_23_level, heroData_23_todayGetExp, heroData_23, heroData_24_currentEquips, heroData_24_level, heroData_24_todayGetExp, heroData_24, heroData_25_currentEquips, heroData_25_level, heroData_25_todayGetExp, heroData_25, heroData_26_currentEquips, heroData_26_level, heroData_26_todayGetExp, heroData_26, heroData_27_currentEquips, heroData_27_level, heroData_27_todayGetExp, heroData_27, heroData_28_currentEquips, heroData_28_level, heroData_28_todayGetExp, heroData_28, heroData_29_currentEquips, heroData_29_level, heroData_29_todayGetExp, heroData_29, heroData_30_currentEquips, heroData_30_level, heroData_30_todayGetExp, heroData_30, heroData_31_currentEquips, heroData_31_level, heroData_31_todayGetExp, heroData_31, heroData_32_currentEquips, heroData_32_level, heroData_32_todayGetExp, heroData_32,
                                        arenaTodayGameTime,arenaTodayGetBadges,arenaTodayLobbyChallengeTimes,arenaTodayLobbyChallengeWinTimes,arenaTodayOpenTimes,
                                        arenaTodayReportChallengeTimes,arenaTodayReportChallengeWinTimes,arenaTodayScoutTimes,arenaTotalGameTime,arenaTotalGetBadges,arenaTotalOpenTimes) 
                    VALUES('$Cents099','$Cents1999','$Cents499','$Cents4999','$Cents9999','$IAPMoney','$allGameTime','$allGetMoney','$createdate','$createdate','$gamename','$deviceid',
                           '$versionNum','$registerDate','$todayGameTime','$openTimes','$todayOpenTimes','$exitWhichScreen','$exitWhichBattleGround','$launchFromNotification','$teamMemberClass',
                           '$todayBuyEquips','$todaySaleEquips','$resetSkillTimes','$resetSkillCost','$buyEquipTimes',
                           '$buyEquipCost','$shopRefreshTimes','$shopRefreshCost','$upgradeTimes','$upgradeCost','$hireHeroTimes','$hireHeroCost',
                           '$survivalBattleTimes','$wavesEachTime','$battleInfos',
                           '$roleClassData_Barbarian_roleClass','$roleClassData_Barbarian_count','$roleClassData_Barbarian_battleTimes','$roleClassData_Fighter_roleClass','$roleClassData_Fighter_count',
                           '$roleClassData_Fighter_battleTimes','$roleClassData_Paladin_roleClass','$roleClassData_Paladin_count','$roleClassData_Paladin_battleTimes',
                           '$heroData_0_currentEquips','$heroData_0_level','$heroData_0_todayGetExp','$heroData_0','$heroData_1_currentEquips','$heroData_1_level',
                            '$heroData_1_todayGetExp','$heroData_1','$heroData_2_currentEquips','$heroData_2_level','$heroData_2_todayGetExp','$heroData_2',
                            '$heroData_3_currentEquips','$heroData_3_level','$heroData_3_todayGetExp','$heroData_3','$heroData_4_currentEquips','$heroData_4_level',
                            '$heroData_4_todayGetExp','$heroData_4','$heroData_5_currentEquips','$heroData_5_level','$heroData_5_todayGetExp','$heroData_5',
                            '$heroData_6_currentEquips','$heroData_6_level','$heroData_6_todayGetExp','$heroData_6','$heroData_7_currentEquips','$heroData_7_level',
                            '$heroData_7_todayGetExp','$heroData_7','$heroData_8_currentEquips','$heroData_8_level','$heroData_8_todayGetExp','$heroData_8',
                            '$heroData_9_currentEquips','$heroData_9_level','$heroData_9_todayGetExp','$heroData_9','$heroData_10_currentEquips','$heroData_10_level',
                            '$heroData_10_todayGetExp','$heroData_10','$heroData_11_currentEquips','$heroData_11_level','$heroData_11_todayGetExp','$heroData_11',
                            '$heroData_12_currentEquips','$heroData_12_level','$heroData_12_todayGetExp','$heroData_12','$heroData_13_currentEquips','$heroData_13_level',
                            '$heroData_13_todayGetExp','$heroData_13','$heroData_14_currentEquips','$heroData_14_level','$heroData_14_todayGetExp','$heroData_14',
                            '$heroData_15_currentEquips','$heroData_15_level','$heroData_15_todayGetExp','$heroData_15','$heroData_16_currentEquips','$heroData_16_level',
                            '$heroData_16_todayGetExp','$heroData_16','$heroData_17_currentEquips','$heroData_17_level','$heroData_17_todayGetExp','$heroData_17',
                            '$heroData_18_currentEquips','$heroData_18_level','$heroData_18_todayGetExp','$heroData_18','$heroData_19_currentEquips','$heroData_19_level','$heroData_19_todayGetExp',
                            '$heroData_19','$heroData_20_currentEquips','$heroData_20_level','$heroData_20_todayGetExp','$heroData_20','$heroData_21_currentEquips',
                            '$heroData_21_level','$heroData_21_todayGetExp','$heroData_21','$heroData_22_currentEquips','$heroData_22_level','$heroData_22_todayGetExp',
                            '$heroData_22','$heroData_23_currentEquips','$heroData_23_level','$heroData_23_todayGetExp','$heroData_23','$heroData_24_currentEquips',
                            '$heroData_24_level','$heroData_24_todayGetExp','$heroData_24','$heroData_25_currentEquips','$heroData_25_level','$heroData_25_todayGetExp',
                            '$heroData_25','$heroData_26_currentEquips','$heroData_26_level','$heroData_26_todayGetExp','$heroData_26','$heroData_27_currentEquips',
                            '$heroData_27_level','$heroData_27_todayGetExp','$heroData_27','$heroData_28_currentEquips','$heroData_28_level','$heroData_28_todayGetExp',
                            '$heroData_28','$heroData_29_currentEquips','$heroData_29_level','$heroData_29_todayGetExp','$heroData_29','$heroData_30_currentEquips',
                            '$heroData_30_level','$heroData_30_todayGetExp','$heroData_30','$heroData_31_currentEquips','$heroData_31_level','$heroData_31_todayGetExp',
                            '$heroData_31','$heroData_32_currentEquips','$heroData_32_level','$heroData_32_todayGetExp','$heroData_32',
                            '$arenaTodayGameTime','$arenaTodayGetBadges','$arenaTodayLobbyChallengeTimes','$arenaTodayLobbyChallengeWinTimes','$arenaTodayOpenTimes','$arenaTodayReportChallengeTimes',
                            '$arenaTodayReportChallengeWinTimes','$arenaTodayScoutTimes','$arenaTotalGameTime','$arenaTotalGetBadges','$arenaTotalOpenTimes'

                           )") or die(mysql_error());
    }
}
fclose($handle);
//fclose($fp);
print "Import successful!<br>";

?>
